package _08_factory_method_pattern.v_common.factory;

import _08_factory_method_pattern.v_common.product.Product;

/**
 * @Description: 具体工厂类
 * @Auther: 2019/6/11 15:45 by zhang.jy
 */
public class ConcreteCreator extends Creator {
	@Override
	public <T extends Product> T createProduct(Class<T> c) {
		Product product = null;
		try {
			product = (Product) Class.forName(c.getName()).newInstance();
		} catch (Exception e) {
			//异常处理
		}
		return (T) product;
	}
}